﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SequentialPattern.BasicClass
{
    /// <summary>
    /// 包含序列支持度的序列樣式, 繼承自序列類別
    /// </summary>
    [Serializable]
    public class Pattern : Sequence
    {
        /// <summary>
        /// 序列支持度
        /// </summary>
        public double Support { get; set; }

        /// <summary>
        /// 建構子
        /// </summary>
        public Pattern() { }

        /// <summary>
        /// 建構子, 並處始化建構子之序列
        /// </summary>
        /// <param name="pattern">初始化之序列</param>
        public Pattern(Pattern pattern)
            : base(pattern)
        {
        }

        /// <summary>
        /// 建構子, 初始化序列並給予支持度
        /// </summary>
        /// <param name="pattern">初始化之序列</param>
        /// <param name="support">支持度</param>
        public Pattern(Pattern pattern, double support)
            : base(pattern)
        {
            this.Support = support;
        }

        /// <summary>
        /// 將序列與支持度轉換成字串
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return base.ToString() + " => " + this.Support;
        }
    }
}
